package routers

import (
	"github.com/xiaomeng79/go-rbac/controllers"
	"github.com/astaxie/beego"
)

func init() {
    beego.Router("/", &controllers.MainController{})
	/*************************管理员******************************/
	beego.Router("/admin/add", &controllers.AdminController{},"get:Add;post:Add")//增加管理员
	beego.Router("/admin/edit", &controllers.AdminController{},"get:Edit;post:Edit")//修改管理员
	beego.Router("/admin/del", &controllers.AdminController{},"post:Del")//删除管理员
	beego.Router("/admin/lst", &controllers.AdminController{},"get:Lst")//管理员列表
	beego.Router("/admin/editpassword", &controllers.AdminController{},"get:EditPassword;post:EditPassword")//修改密码
	beego.Router("/admin/login", &controllers.AdminController{},"get:Login;post:Login")//登录
	beego.Router("/admin/logout", &controllers.AdminController{},"get:Logout")//退出

	/*************************角色******************************/
	beego.Router("/role/add", &controllers.RoleController{},"get:Add;post:Add")//增加角色
	beego.Router("/role/edit", &controllers.RoleController{},"get:Edit;post:Edit")//修改角色
	beego.Router("/role/del", &controllers.RoleController{},"post:Del")//删除角色
	beego.Router("/role/lst", &controllers.RoleController{},"get:Lst")//角色列表

	/*************************权限******************************/
	beego.Router("/privilege/add", &controllers.PrivilegeController{},"get:Add;post:Add")//增加权限
	beego.Router("/privilege/edit", &controllers.PrivilegeController{},"get:Edit;post:Edit")//修改权限
	beego.Router("/privilege/del", &controllers.PrivilegeController{},"post:Del")//删除权限
	beego.Router("/privilege/lst", &controllers.PrivilegeController{},"get:Lst")//权限列表
}
